﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Store_Keeper/Store_Keeper.master" AutoEventWireup="true" CodeFile="SK_GTNRequest.aspx.cs" Inherits="Store_Keeper_SK_GTNRequest" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
    <style type="text/css">
        .style2
        {
            width: 100%;
        }
        .style3
        {
            margin-left: 0px;
        }
        .style4
        {
            width: 303px;
        }
        .style5
        {
            color: #0000FF;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" 
        ClientIDMode="AutoID" CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
        CssPostfix="BlackGlass" DataSourceID="SqlDataSource1" KeyFieldName="Sto_ID" 
        Width="100%" onselectionchanged="ASPxGridView1_SelectionChanged">
        <Columns>
             <dx:GridViewCommandColumn VisibleIndex="0" ShowSelectCheckbox="True">
           
            </dx:GridViewCommandColumn>
            <dx:GridViewDataTextColumn FieldName="Sto_ID" ReadOnly="True" VisibleIndex="0" 
                Caption="Stock Code">
                <EditFormSettings Visible="False" />
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Pro_ID" ReadOnly="True" 
                VisibleIndex="2" Caption="Item ID">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Code" VisibleIndex="3" 
                Caption="Item Code">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Pro_Name" VisibleIndex="1" Caption="Item" 
                ReadOnly="True">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Brand_Name" VisibleIndex="5" 
                Caption="Brand ">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Cost" FieldName="Pur_Price" 
                VisibleIndex="6">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Selling Price" FieldName="Ret_Price" 
                VisibleIndex="7">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Quantity" FieldName="Qty_in_stock" 
                VisibleIndex="4">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Point Value" FieldName="Point_Value" 
                VisibleIndex="8">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Caption="Business Value" FieldName="Business_Value" 
                VisibleIndex="9">
            </dx:GridViewDataTextColumn>
            
        </Columns>
        <SettingsPager PageSize="3">
        </SettingsPager>
        <Settings ShowFilterRow="True" />
        <Images SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css">
            <LoadingPanelOnStatusBar Url="~/App_Themes/BlackGlass/GridView/gvLoadingOnStatusBar.gif">
            </LoadingPanelOnStatusBar>
            <LoadingPanel Url="~/App_Themes/BlackGlass/GridView/Loading.gif">
            </LoadingPanel>
        </Images>
        <ImagesFilterControl>
            <LoadingPanel Url="~/App_Themes/BlackGlass/Editors/Loading.gif">
            </LoadingPanel>
        </ImagesFilterControl>
        <Styles CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
            CssPostfix="BlackGlass">
            <Header ImageSpacing="5px" SortingImageSpacing="5px">
            </Header>
        </Styles>
        <StylesEditors>
            <CalendarHeader Spacing="1px">
            </CalendarHeader>
            <ProgressBar Height="25px">
            </ProgressBar>
        </StylesEditors>
    </dx:ASPxGridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BestlifeDBConnectionString %>" 
        DeleteCommand="DELETE FROM [Tbl_Stock] WHERE [Sto_ID] = @Sto_ID AND [Pro_Name] = @Pro_Name AND [Pro_ID] = @Pro_ID" 
        InsertCommand="INSERT INTO [Tbl_Stock] ([Pro_Name], [Code], [Qty_in_stock], [Pro_ID]) VALUES (@Pro_Name, @Code, @Qty_in_stock, @Pro_ID)" 
        SelectCommand="SELECT Tbl_Stock.Sto_ID, Tbl_Stock.Pro_Name, Tbl_Stock.Code, Tbl_Stock.Qty_in_stock, Tbl_Stock.Pro_ID, Tbl_Product.Ret_Price, Tbl_Product.Point_Value, Tbl_Product.Business_Value, Tbl_Product.Brand_Name, Tbl_Product.Pur_Price FROM Tbl_Stock INNER JOIN Tbl_Product ON Tbl_Stock.Code = Tbl_Product.Code AND Tbl_Stock.Pro_ID = Tbl_Product.Pro_ID" 
        
        UpdateCommand="UPDATE [Tbl_Stock] SET [Code] = @Code, [Qty_in_stock] = @Qty_in_stock WHERE [Sto_ID] = @Sto_ID AND [Pro_Name] = @Pro_Name AND [Pro_ID] = @Pro_ID">
        <DeleteParameters>
            <asp:Parameter Name="Sto_ID" Type="Int32" />
            <asp:Parameter Name="Pro_Name" Type="String" />
            <asp:Parameter Name="Pro_ID" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Pro_Name" Type="String" />
            <asp:Parameter Name="Code" Type="String" />
            <asp:Parameter Name="Qty_in_stock" Type="Decimal" />
            <asp:Parameter Name="Pro_ID" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Code" Type="String" />
            <asp:Parameter Name="Qty_in_stock" Type="Decimal" />
            <asp:Parameter Name="Sto_ID" Type="Int32" />
            <asp:Parameter Name="Pro_Name" Type="String" />
            <asp:Parameter Name="Pro_ID" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <br />
    <table class="style2">
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td class="dxtcRightAlignCell_BlackGlass">
                <dx:ASPxLabel ID="ASPxLabel3" runat="server" 
                    Text="Select Above Stock and Click " Font-Bold="True" Font-Size="Small" 
                    ForeColor="#000099">
                </dx:ASPxLabel>
                </td>
            <td class="dxtcLeftAlignCell_BlackGlass">
                <dx:ASPxButton ID="ASPxButton1" runat="server" ClientIDMode="AutoID" 
                    CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" CssPostfix="Office2003Olive" 
                    SpriteCssFilePath="~/App_Themes/Office2003Olive/{0}/sprite.css" Text="Add" 
                    onclick="ASPxButton1_Click" CssClass="style3" Height="34px" Width="174px">
                </dx:ASPxButton>
                </td>
        </tr>
        <tr>
            <td>
                <dx:ASPxLabel ID="Label7" runat="server" Visible="False">
                </dx:ASPxLabel>
                <dx:ASPxLabel ID="Label1" runat="server" Visible="False">
                </dx:ASPxLabel>
            </td>
            <td>
                <dx:ASPxLabel ID="error" runat="server" ForeColor="Red" Visible="False">
                </dx:ASPxLabel>
            </td>
            <td class="dxtcRightAlignCell_BlackGlass">
                &nbsp;</td>
            <td class="dxtcLeftAlignCell_BlackGlass">
                &nbsp;</td>
        </tr>
    </table>
    
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
        CellPadding="3" ForeColor="Black" GridLines="Vertical" 
        Width="100%" onrowupdating="GridView1_RowUpdating" 
        onrowediting="GridView1_RowEditing" 
        onrowcancelingedit="GridView1_RowCancelingEdit" 
        onrowdeleting="GridView1_RowDeleting">
        <AlternatingRowStyle BackColor="#CCCCCC" />
        <Columns>
            <asp:BoundField DataField="Item ID" HeaderText="Product ID" ReadOnly="True" />
            <asp:BoundField DataField="Item Code" HeaderText="Product Code" ReadOnly="True" />
            <asp:BoundField DataField="Item" HeaderText="Product Name" ReadOnly="True" />
            <asp:BoundField DataField="Stock Code" HeaderText="Stock Code" ReadOnly="True" />
            <asp:BoundField DataField="Brand" HeaderText="Brand" ReadOnly="True" />
             <asp:BoundField DataField="cost" HeaderText="Cost" ReadOnly="True" />
            <asp:BoundField DataField="Selling Price" HeaderText="Selling Price" ReadOnly="True" 
                 />
            <asp:TemplateField HeaderText="Quantity">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Quantity") %>' ></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("Quantity") %>' ></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="True" />
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
        <FooterStyle BackColor="#CCCCCC" />
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" 
            HorizontalAlign="Left" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#808080" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#383838" />
    </asp:GridView>
   
    <br />
    <br />
    <table class="style2">
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                <strong>
                <dx:ASPxRadioButton ID="ASPxRadioButton1" runat="server" CssClass="style5" 
                    Font-Size="Small" GroupName="Branch" Text="Panadura" Checked="True" 
                    Height="31px" Width="94px">
                </dx:ASPxRadioButton>
                </strong></td>
            <td class="style4">
                <strong>
                <dx:ASPxRadioButton ID="ASPxRadioButton2" runat="server" CssClass="style5" 
                    Font-Size="Small" GroupName="Branch" Text="Kandy" Height="41px" 
                    Width="79px">
                </dx:ASPxRadioButton>
                </strong></td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                <strong>
                <dx:ASPxLabel ID="ASPxLabel2" runat="server" ForeColor="#009933">
                </dx:ASPxLabel>
                </strong>
            </td>
            <td>
                &nbsp;</td>
            <td align="left" class="style4">
                <dx:ASPxButton ID="Checkout" runat="server" ClientIDMode="AutoID" 
                    CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css" CssPostfix="SoftOrange" 
                    onclick="Checkout_Click" 
                    SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css" 
                    Text="Transfer to Food City Stock" CssClass="style3" Height="34px" Visible="False" 
                    Width="174px">
                </dx:ASPxButton>
            </td>
            <td align="left">
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

